#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(int argc, char const *argv[])
{
/*
//输入8个整数判断奇、偶，并分别输出奇数，偶数
    int str1[8]={0};
 
    for (int i = 0; i < 8; i++)
    {
        printf("请输入%d个数>:",i+1);
        scanf("%d",&str1[i]);
    }

    printf("数组内容为>: ");
    for (int i = 0; i < 8; i++)
    {
        printf("%d ",str1[i]);
    }
    printf("\n");
    printf("奇数数组内容为>: ");
    for (int i = 0; i < 8; i++)
    {
        if(str1[i]%2!=0)
        {
            printf("%d ",str1[i]);
        }
    }
    printf("\n");
    printf("偶数数组内容为>: ");
    for (int i = 0; i < 8; i++)
    {
        if(str1[i]%2==0)
        {
            printf("%d ",str1[i]);
        }
    }

//输入8个整数判断奇、偶，并分别输出奇数，偶数
    int a[8]={1,2,3,4,5,6,7,8};
    int b[4]={0};
    int c[4]={0};

    int index_b=0, index_c=0;
    for (int i = 0; i < 8; i++)
    {
        if(a[i]%2 != 0)
        {
            b[index_b++]=a[i];
        }
        else if(a[i]%2 == 0)
        {
            c[index_c++]=a[i];
        }
    }
    printf("奇数数组内容为>:\n");
    for (int i = 0; i < 4; i++)
    {
        printf("b[%d]=%d\n",i,b[i]);
    }

    printf("偶数数组内容为>:\n");
    for (int i = 0; i < 4; i++)
    {
        printf("c[%d]=%d\n",i,c[i]);
    }


//char str[]="Attendees at a Trump rally in Waukesha, Wisconsin, shared who they want to see on the presidential ticket in 2024, with most hoping for a Donald Trump bid."
//将上面的大写换成小写，空格去掉

    char str[]="Attendees at a Trump rally in Waukesha, Wisconsin, shared who they want to see on the presidential ticket in 2024, with most hoping for a Donald Trump bid.";

    printf("str=%s\n",str);

    printf("大写转小写后内容为:\n");
    for (int i = 0; i < sizeof(str)/sizeof(str[0]); i++)
    {
       if ((str[i]<='Z')&&(str[i]>='A'))
       {
        str[i] += ' ';
       }   
    }
    printf("str=%s\n",str);

    printf("去除空格后内容为:\n");
    for (int i = 0; i < sizeof(str)/sizeof(str[0]); i++)
    {
       if (str[i]==' ')
       {
        str[i] = str[i+1];
       }   
    }
    printf("str=%s\n",str);
*/


    return 0;
}
